import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {HttpServiceProvider} from '../../providers/http-service/http-service';
import {LoggerProvider} from '../../providers/logger/logger';

/**
 * Generated class for the HelloPage page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */
@IonicPage()
@Component({
  selector: 'page-hello',
  templateUrl: 'hello.html',
  // providers: [HttpServiceProvider]
})
export class HelloPage {
  items: object;

  constructor(public navCtrl: NavController,
              public navParams: NavParams,
              public httpService: HttpServiceProvider,
              public logger: LoggerProvider) {

    this.init();
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad HelloPage');
  }

  init() {
    this.logger.log('hello');
    this.httpService.get('./assets/mock/data.json').subscribe(data => {
      this.logger.log(data);
    })
  }

}
